<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 

// 선택옵션으로 인해 셀합치기가 가변적으로 변함
$colspan = 5;

//if ($is_category) $colspan++;
if ($is_checkbox) $colspan++;
if ($is_good) $colspan++;
if ($is_nogood) $colspan++;

// 제목이 두줄로 표시되는 경우 이 코드를 사용해 보세요.
// <nobr style='display:block; overflow:hidden; width:000px;'>제목</nobr>
?>

<link rel="stylesheet" type="text/css" href="/css/home.css">
<link rel="stylesheet" type="text/css" href="/css/reset.css">
<script src="http://maps.google.co.kr/maps?file=api&amp;v=2&amp;key=ABQIAAAAMzk_wa5vWXjb8Hlx2Zsp0RTnHXbg4JNqWsj05gtbf8SYI4YLQxTRK3ZParLpK6mDgyRozTiW0R4E6Q" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">
function calcDistance(lat1, lon1, lat2, lon2){
    var EARTH_R, Rad, radLat1, radLat2, radDist; 
    var distance, ret;

    EARTH_R = 6371000.0;
    Rad = Math.PI/180;
    radLat1 = Rad * lat1;
    radLat2 = Rad * lat2;
    radDist = Rad * (lon1 - lon2);
    
    distance = Math.sin(radLat1) * Math.sin(radLat2);
    distance = distance + Math.cos(radLat1) * Math.cos(radLat2) * Math.cos(radDist);
    ret = EARTH_R * Math.acos(distance);

    retDistance = (Math.round(Math.round(ret))<1000)?Math.round(Math.round(ret))+" m":(Math.round(Math.round(ret))/1000)+" km";

    return  retDistance;
}

var map;
function mapCenter(latitude, longitude){
	map.setCenter(new GLatLng(latitude, longitude), 16);
}

$(document).ready(function(){
	map = new GMap2(document.getElementById("map"));
	map.addControl(new GSmallMapControl()); 
	map.addControl(new GMapTypeControl()); 
	//map.addControl(new GNavLabelControl());

	map.setCenter(new GLatLng(<?=$latitude?>, <?=$longitude?>), 16);
	map.addOverlay(createMarker(new GLatLng(<?=$latitude?>, <?=$longitude?>), '0', "<?=$stx?>"));

	var icon_red = new GIcon(); 
	icon_red.image = "/img/home/mm_20_red.png"; 
	icon_red.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png"; 
	icon_red.iconSize = new GSize(27, 35); 
	icon_red.shadowSize = new GSize(22, 20); 
	icon_red.iconAnchor = new GPoint(6, 20); 
	icon_red.infoWindowAnchor = new GPoint(5, 1);

	var icon_blue = new GIcon(); 
	icon_blue.image = "/img/home/mm_20_green.png"; 
	icon_blue.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png"; 
	icon_blue.iconSize = new GSize(27, 35); 
	icon_blue.shadowSize = new GSize(22, 20); 
	icon_blue.iconAnchor = new GPoint(6, 20); 
	icon_blue.infoWindowAnchor = new GPoint(5, 1);

	var icon_green = new GIcon(); 
	icon_green.image = "/img/home/mm_20_blue.png"; 
	icon_green.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png"; 
	icon_green.iconSize = new GSize(27, 35); 
	icon_green.shadowSize = new GSize(22, 20); 
	icon_green.iconAnchor = new GPoint(6, 20); 
	icon_green.infoWindowAnchor = new GPoint(5, 1);

	var icon_marker = new GIcon(); 
	icon_marker.image = "http://www.google.com/mapfiles/marker.png";
	icon_marker.iconSize = new GSize(12, 20); 
	icon_marker.shadowSize = new GSize(22, 20); 
	icon_marker.iconAnchor = new GPoint(6, 20); 
	icon_marker.infoWindowAnchor = new GPoint(5, 1);
	
	function createMarker(point, wr_1, infoStr)  
	{ 
	  var icon;
	  if (wr_1=="D1"){
		  icon = icon_green;
	  }else if (wr_1=="D2"){
		  icon = icon_blue;
	  }else if (wr_1=="D3"){
		  icon = icon_red;
	  }else {
		  icon = icon_marker;
	  }
	  var marker = new GMarker(point, icon); 
	  GEvent.addListener(marker, "mouseover", function()  
	  { 
	    marker.openInfoWindowHtml("<b>" + infoStr + "</b>"); 
	  }); 
	  GEvent.addListener(marker, "mouseout", function()  
	  { 
	    marker.closeInfoWindow(); 
	  }); 
	  GEvent.addListener(marker, "click", function()  
	  { 
	    alert (infoStr);
	  });
	  return marker; 
	} 

	<?for ($j=0;$j<count($list); $j++) {
		echo "map.addOverlay(createMarker(new GLatLng(".$list[$j]['latitude'].", ".$list[$j]['longitude']."), '{$list[$j]['wr_1']}', '거리 : '+calcDistance({$list[$j]['latitude']}, {$list[$j]['longitude']}, {$latitude}, {$longitude}) +'</br>주소 : {$list[$j][mb_addr1]} {$list[$j][mb_addr2]} </br>가격 : ".han_price($list[$j][homePrice])."' ));";
		//echo "alert ((map.fromContainerPixelToLatLng(new GLatLng(".$list[$j]['latitude'].", ".$list[$j]['longitude'].")).distanceFrom(map.fromContainerPixelToLatLng(new GLatLng(37.5006350, 127.0363890)))/1000*254).toFixed(5));";
		//echo "alert (calcDistance({$list[$j]['latitude']}, {$list[$j]['longitude']}, {$latitude}, {$longitude}));";
	}?>

	$(".bigImg").bind('click',function(){
		if ($(this).attr("src") != "/img/noImage183x136.gif"){
			$("#layerImg0").attr("src",$(this).attr("src"));
			var newImg = new Image();
			newImg.src = $(this).attr("src");
			if ((newImg.width*411/newImg.height) > 711){
				$("#layerImg0").attr("width",'711');
			}else{
				$("#layerImg0").attr("width",newImg.width*411/newImg.height);
			}
			$("#layerImg1").attr("src",$(this).parent().parent().next().find('img').eq('0').attr("src"));
			$("#layerImg2").attr("src",$(this).parent().parent().next().find('img').eq('1').attr("src"));
			$("#layerImg3").attr("src",$(this).parent().parent().next().find('img').eq('2').attr("src"));
			$("#layerImg4").attr("src",$(this).parent().parent().next().find('img').eq('3').attr("src"));
			yPosition = $(document).scrollTop()-200;   
		    $("#bigImage").animate({"top":yPosition }, {duration:'fast', easing:'swing', queue:false});
			$("#bigImage").show();
			$("body").css("oracity","0.2");
			$("body").css("filter","alpha(opacity=20)");
			document.body.scroll = "no";
		    document.body.style.overflow = 'hidden';
		}
	});

	$(".classImg").bind('click',function(){
		$("#layerImg0").attr("src",$(this).attr("src"));
		var newImg = new Image();
		newImg.src = $(this).attr("src");
		if ((newImg.width*411/newImg.height) > 711){
			$("#layerImg0").attr("width",'711');
		}else{
			$("#layerImg0").attr("width",newImg.width*411/newImg.height);
		}
	});

	$(".imgClass").click(function(event){ 
		event.stopPropagation();
	});
	
	$(document.body).click(function(){
		hideBigImage();
	});

	//스크롤이벤트가 발생하면   
	$(window).scroll(function(){   
	    yPosition = $(document).scrollTop()-200;   
	    $("#bigImage").animate({"top":yPosition }, {duration:'fast', easing:'swing', queue:false});   
	});   
		

	/*map.openInfoWindow(map.getCenter(),
	                   document.createTextNode("저여기 살아요"));*/
});


function hideBigImage(){
	$("#bigImage").hide();
	$("body").css("oracity","");
	$("body").css("filter","");
	document.body.scroll = "yes";
	document.body.style.overflow = 'scroll';
}

function nextImg(){
	flagCon = true;
	$("#pLayer").find("img").each(function(index){
		if ($(this).attr("src")==$("#layerImg0").attr("src") && index < 3 && flagCon){
			$("#layerImg0").attr("src",$("#layerImg"+(index+2)).attr("src"));
			flagCon=false;
		}
	});
}

function nextImg(goPos){
	flagCon = true;
	$("#pLayer").find("img").each(function(index){
		if (goPos==1){
			if ($(this).attr("src")==$("#layerImg0").attr("src") && index < 3 && flagCon){
				$("#layerImg0").attr("src",$("#layerImg"+(index+2)).attr("src"));
				var newImg = new Image();
				newImg.src = $("#layerImg"+(index+2)).attr("src");
				if ((newImg.width*411/newImg.height) > 711){
					$("#layerImg0").attr("width",'711');
				}else{
					$("#layerImg0").attr("width",newImg.width*411/newImg.height);
				}
				flagCon=false;
			}
		}else{
			if ($(this).attr("src")==$("#layerImg0").attr("src") && index > 0 && flagCon){
				$("#layerImg0").attr("src",$("#layerImg"+(index)).attr("src"));
				var newImg = new Image();
				newImg.src = $("#layerImg"+(index)).attr("src");
				if ((newImg.width*411/newImg.height) > 711){
					$("#layerImg0").attr("width",'711');
				}else{
					$("#layerImg0").attr("width",newImg.width*411/newImg.height);
				}
				flagCon=false;
			}
		}
	});
}
</script>



<!-- table width="100%" cellpadding=0 cellspacing=0><tr><td valign=top>
	<tr>
		<td>
			<a href="<?=$g4['path']?>/bbs/write_<?=$bo_table?>.php?bo_table=<?=$bo_table?>">게시글 작성</a>
		</td>
	</tr>
	<tr>
		<td>
			<a href="#">판매글</a>
			<a href="<?=$g4['path']?>/bbs/board_<?=$bo_table?>.php?bo_table=<?=$bo_table?>">구매글</a>
			<a href="<?=$g4['path']?>/bbs/board_<?=$bo_table?>.php?bo_table=<?=$bo_table?>&gubun=univer">대학별</a>
		</td>
	</tr>
</table -->

<div id="wrap">
	<div id="contents">
	<!-- contents -->
		<h1><a href="/"><img src="../img/comm/logo.gif" /></a></h1>
		<div class="search_wrap">
			<p><img src="../img/home/txt_001.gif" /></p>
			<div >
			        <form name="fsearchbox" method="get" onsubmit="return fsearchbox_submit(this);" style="margin:0px;">
	            	<input type="hidden" name="sfl" value="wr_subject||wr_content"/>
        			<input type="hidden" name="sop" value="and"/>
        			<input type="hidden" name="bo_table" value="<?=$bo_table?>"/>
	            	<input name="stx" type="text" class="box5" id="stx" value="<?=$stx?>" />
	            	<input type="image" src="../img/product/bt_search.gif" width="59" height="37" align="absmiddle" />
	            	</form>
			</div>
		</div>
		<div id="bigImage" class="imgClass" style="position:relative;display: none;">
			<div style="position:absolute; top:30px; left:30px; width:830px; height:600px; background:#000; z-index:999;">
				<div style="position:absolute; left:60px; top:20px;">
					<p style="margin-bottom:17px;" align="center"><img id="layerImg0" src="../img/home/sample_img01.gif" width='711' height="411" /></p>
					<p id="pLayer" style="width:711px; text-align:center;">
						<a href="javascript:" style="margin-right:16px"><img id="layerImg1" src="../img/home/sample_img02.gif" width='162' height="126" class="classImg" /></a>
						<a href="javascript:" style="margin-right:16px"><img id="layerImg2" src="../img/home/sample_img02.gif" width='162' height="126" class="classImg" /></a>
						<a href="javascript:" style="margin-right:16px"><img id="layerImg3" src="../img/home/sample_img02.gif" width='162' height="126" class="classImg" /></a>
						<a href="javascript:"><img id="layerImg4" src="../img/home/sample_img02.gif" width='162' height="126" class="classImg" /></a>
					</p>
				</div>
				<div style="position:absolute; left:30px; top:222px;"><a href="javascript:nextImg(-1);"><img src="../img/home/btn_pre.gif" /></a></div>
				<div style="position:absolute; left:789px; top:222px;"><a href="javascript:nextImg(1);"><img src="../img/home/bt_next.gif" /></a></div>
				<div style="position:absolute; top:7px; right:7px;"><a href="javascript:hideBigImage();"><img src="../img/home/btn_close.gif" /></a></div>
			</div>
			
		</div>
		<div id="map" style="width: 670px; height: 610px;" class="map" ></div>
		<div class="icon001">
			<img src="../img/home/map_icon01.gif" />
			<img src="../img/home/map_icon02.gif" />
			<img src="../img/home/map_icon03.gif" />
		</div>
	<!-- /contents -->
	</div>
	<div id="aside">
	<!-- aside -->
		<div class="top_menu">
			<a href="/"><img src="../img/comm/smenu_home.gif" border="0" /></a>
			<img src="../img/comm/smenu_line.gif" />
			<a href="<?=$g4['path']?>/bbs/board_sellitem.php?bo_table=sellitem"><img src="../img/comm/smenu_buy01.gif" border="0" /></a>
			<img src="../img/comm/smenu_line.gif" />
			<a href="<?=$g4['path']?>/bbs/board_sellhome.php?bo_table=sellhome"><img src="../img/comm/smenu_home02.gif" border="0" /></a>
			<img src="../img/comm/smenu_line.gif" />
			<a href="#"><img src="../img/comm/smenu_job.gif" border="0" /></a>
		</div>
		<div class="user_info">
			<?=outlogin("basic2"); // 외부 로그인 ?>
		</div>
		<div class="icon_write">
			<a href="<?=$g4['path']?>/bbs/write_sellhome.php?bo_table=<?=$bo_table?>"><img src="../img/comm/bt_write.gif" style="vertical-align:middle;" /></a>
		</div>
		<div style="text-align:center; margin-bottom:12px;">
			<a href="/bbs/board_sellhome.php?bo_table=sellhome"><img src="../img/home/tab01_on.gif" style="vertical-align:middle;" /></a>
			<a href="/bbs/board_buyhome.php?bo_table=buyhome"><img src="../img/home/tab02.gif" style="vertical-align:middle;" /></a>
		</div>
		<div class="select_way">
			<span><input type="radio" class="aty01" name="aty01" onclick="javascript:goMySearch('my_sellgubun','D1','<?=$stx?>');" <?if($param_data=="D1")echo "checked";?> value="D1" /> 월세</span>
			<span><input class="aty01" type="radio" name="aty01" onclick="javascript:goMySearch('my_sellgubun','D2','<?=$stx?>');" <?if($param_data=="D2")echo "checked";?> value="D2" /> 전세</span>
			<span><input class="aty01" type="radio" name="aty01" onclick="javascript:goMySearch('my_sellgubun','D3','<?=$stx?>');" <?if($param_data=="D3")echo "checked";?> value="D3" /> 매매</span>
		</div>
		<div class="days">
			<div style="width:101px; margin:0 auto;">
				<div style="height:55px; border-bottom:1px solid #dbdbdb; text-align:center;margin:0;margin-bottom:4px;"><img src="/img/comm/num_0<?=substr(date("d"),0,1)?>.jpg" alt="" /> <img src="/img/comm/num_0<?=substr(date("d"),1,1)?>.jpg" alt="" /> </div>
				<div style="overflow:hidden;">
					<div style="float:left;"><img src="/img/comm/mon_<?=date("m")?>.jpg" alt="" /></div>
					<div style="float:right;"><img src="/img/comm/year_<?=date("Y")?>.jpg" alt="" /></div>
				</div>
			</div>
		</div>
		<!-- 분류 셀렉트 박스, 게시물 몇건, 관리자화면 링크 -->

		<div id="dis_table">
	    <? 
	    for ($i=0; $i<count($list); $i++) { 
	        $bg = $i%2 ? 0 : 1;
	    ?>
		<!-- 매물01 -->
		<div class="home_info">
			<div style="overflow:hidden;margin-bottom:5px;">
				<div class="text01" style="float:left;"><a href="javascript:mapCenter(<?=$list[$i][latitude]?>, <?=$list[$i][longitude]?>);"><?=$list[$i][mb_addr1]?></a> <img src="../img/home/subway_3.gif" style="vertical-align:middle;" /></div>
				<div style="text-align:right;float:right;">By <?=$list[$i][name]?>
					<div style="width:56px; height:19px; background:url('../img/product/days02_bg.gif') no-repeat; color:#fff; font-size:12px;text-align:center;padding-top:3px;">
					<?=$list[$i][diff]?>
					</div>
				</div>
			</div>
			<div class="mm_info01">
				<div>
					<?if (!$list[$i][file][0]){?>
                    <img src="/img/noImage183x136.gif" style="vertical-align:middle;border:1px solid #d5d5d5;" width="120" height="100" class='bigImg'/>
                    <?} else {?>
                    <a href="javascript:"><img src="<?echo $list[$i][file][0][path]."/".$list[$i][file][0][file]?>" style="vertical-align:middle;border:1px solid #d5d5d5;" width="120" height="100" class='bigImg imgClass'/></a>
                    <?}?>
				</div>
				<div>
					<?if ($list[$i][file][0]){
	                	echo "<a href=\"javascript:imgChange(".$i.",'".$list[$i][file][0][path]."/".$list[$i][file][0][file]."');\"><img src='".$list[$i][file][0][path]."/".$list[$i][file][0][file]."' align='absmiddle' border='0' width='30' height='25'></a>";
	                } else {
	                    echo "<img src=\"/img/noImage183x136.gif\" width=\"30\" height=\"25\" />";
	                }
	                if ($list[$i][file][1]){
	                    echo "<a href=\"javascript:imgChange(".$i.",'".$list[$i][file][1][path]."/".$list[$i][file][1][file]."');\"><img src='".$list[$i][file][1][path]."/".$list[$i][file][1][file]."' align='absmiddle' border='0' width='30' height='25'></a>";
	                } else {
	                   	echo "<img src=\"/img/noImage183x136.gif\" width=\"30\" height=\"25\" />";
	                }
	                if ($list[$i][file][2]){
	                    echo "<a href=\"javascript:imgChange(".$i.",'".$list[$i][file][2][path]."/".$list[$i][file][2][file]."');\"><img src='".$list[$i][file][2][path]."/".$list[$i][file][2][file]."' align='absmiddle' border='0' width='30' height='25'></a>";
	                } else {
	                   	echo "<img src=\"/img/noImage183x136.gif\" width=\"30\" height=\"25\" />";
	                }
	                if ($list[$i][file][3]){
	                    echo "<a href=\"javascript:imgChange(".$i.",'".$list[$i][file][3][path]."/".$list[$i][file][3][file]."');\"><img src='".$list[$i][file][3][path]."/".$list[$i][file][3][file]."' align='absmiddle' border='0' width='30' height='25'></a>";
	                } else {
	                   	echo "<img src=\"/img/noImage183x136.gif\" width=\"30\" height=\"25\" />";
	                }
	                ?>
				</div>
			</div>
			<div class="mm_info02">
				<div style="color:#464646; letter-spacing:-0.05em;margin-bottom:20px;">
					<?if($list[$i][wr_2]=="L1"){echo "원룸";}else if($list[$i][wr_2]=="L2"){echo "오피스텔";}else if($list[$i][wr_2]=="L3"){echo "아파트";}?>
					&nbsp;&nbsp;<?=$list[$i][wr_3]?>
					&nbsp;&nbsp;<?if ($list[$i][wr_1]=='D1'){echo "<img src=\"../img/home/b_001.jpg\" style=\"vertical-align:middle;\" />";}else if ($list[$i][wr_1]=='D2'){echo "<img src=\"../img/home/b_002.jpg\" style=\"vertical-align:middle;\" />";} else if ($list[$i][wr_1]=='D3'){echo "<img src=\"../img/home/b_003.jpg\" style=\"vertical-align:middle;\" />";}?><?=han_price($list[$i][homePrice])?>
				</div>
				<p style="padding-bottom:13px;"><!-- img src="../img/home/icon_pro.gif" style="vertical-align:middle;" /--></p>
				<p style="color:#929292;margin-bottom:14px;">입주가능<?=$list[$i][wr_4]?></p>
				<p style="padding-bottom:13px;text-align:right;">
				<? if ($member['mb_id']) { ?>
					<img src="../img/home/btn_pomm.gif" style="vertical-align:middle;cursor:pointer;" onclick="javascript:goScrap(<?=$list[$i][wr_id]?>);" />
				<? }	?>
				</p>
				<? if ($list[$i][chkMore]) {?>
					<p style="padding-bottom:5px;"><img src="../img/product/btn_up.gif" style="vertical-align:middle;" /></p>
				<?}?>
			</div>
		</div>
		<?}?>
		</div>
		
		<div>
			<a href="javascript:add_dis_table()">
				<img src="<?=$board_skin_path?>/img/btn_more.gif" align="absmiddle" border='0' alt="더보기">
			</a>
		</div>
	<!-- //aside -->
	</div>
</div>
<form name="ajaxFrm" method="post">
	<input type="hidden" name="page" value="<?=count($list)<12?0:$page?>">
</form>



<script type="text/javascript">
if ('<?=$sca?>') document.fcategory.sca.value = '<?=$sca?>';
if ('<?=$stx?>') {
    //document.fsearch.sfl.value = '<?=$sfl?>';

    /*if ('<?=$sop?>' == 'and') 
        document.fsearch.sop[0].checked = true;

    if ('<?=$sop?>' == 'or')
        document.fsearch.sop[1].checked = true;*/
} else {
    //document.fsearch.sop[0].checked = true;
}

function imgChange(imgNo, imgPath){
	$(".bigImg").eq(imgNo).attr("src",imgPath);
}

function goScrap(wrId){
	$.ajax({
		  type: "POST",
		  url: "<?=$board_skin_path?>/scrap_ajax.php",
		  data: {
			  "mb_id": "<?=$member[mb_id]?>",
			  "bo_table": "<?=$bo_table?>",
			  "wr_id" : wrId
		  },
		  success: function(html){
			  if(html == "0"){
				alert("해당 상품을 관심매물에 추가하였습니다");
				$("#viewInter").text(eval($("#viewInter").text())+1);
			  }else{
			    alert("이미 관심매물에 등록된 상품입니다.");
			  }
		  }
	});
}

function showDetail(detailNo){

	if ($(".spanDiv").eq(detailNo).text()=="더보기"){
		$(".spanDiv").eq(detailNo).text("감추기");
		$(".divDetail").eq(detailNo).show("fast");
	}else{
		$(".spanDiv").eq(detailNo).text("더보기");
		$(".divDetail").eq(detailNo).hide("fast");
	}
}

function add_dis_table(){
	$.ajax({
		  type: "POST",
		  url: "<?=$board_skin_path?>/list_view_ajax2.php",
		  data: {
			  "page": eval(document.ajaxFrm.page.value)+1,
			  "bo_gubun": "<?=$bo_gubun?>",
			  "sop": "<?=$sop?>",
			  "sca": "<?=$sca?>",
			  "sfl": "<?=$sfl?>",
			  "stx": encodeURIComponent('<?=$stx?>'),
			  "write_table": "<?=$g4['write_prefix'].$bo_table?>",
			  "bo_table": "<?=$bo_table?>",
			  "mb_id": "<?=$member['mb_id']?>",
			  "param_data": encodeURIComponent('<?=$param_data?>'),
			  "page_row": "3",
			  "is_admin":"<?=$is_admin?>",
			  "is_auth": "<?=$is_auth?>"
		  },
		  success: function(html){
			  if(html == "0"){
				  alert("더이상 데이터가 없습니다.");
				  return;
			  }else{
				  var objTbl = $("#dis_table")[0];
				  objTbl.insertAdjacentHTML("afterEnd", html);
				  document.ajaxFrm.page.value = eval(document.ajaxFrm.page.value)+1;
			  }
		  }
		});
}

function fsearchbox_submit(f)
{
    if (f.stx.value.length < 2) {
        alert("검색어는 두글자 이상 입력하십시오.");
        f.stx.select();
        f.stx.focus();
        return false;
    }

    // 검색에 많은 부하가 걸리는 경우 이 주석을 제거하세요.
    /*var cnt = 0;
    for (var i=0; i<f.stx.value.length; i++) {
        if (f.stx.value.charAt(i) == ' ')
            cnt++;
    }

    if (cnt > 1) {
        alert("빠른 검색을 위하여 검색어에 공백은 한개만 입력할 수 있습니다.");
        f.stx.select();
        f.stx.focus();
        return false;
    }*/

    f.action = "<?=$g4['path']?>/bbs/board_<?=$bo_table?>.php";
    return true;
}
</script>

<? if ($is_checkbox) { ?>
<script type="text/javascript">
function all_checked(sw) {
    var f = document.fboardlist;

    for (var i=0; i<f.length; i++) {
        if (f.elements[i].name == "chk_wr_id[]")
            f.elements[i].checked = sw;
    }
}

function check_confirm(str) {
    var f = document.fboardlist;
    var chk_count = 0;

    for (var i=0; i<f.length; i++) {
        if (f.elements[i].name == "chk_wr_id[]" && f.elements[i].checked)
            chk_count++;
    }

    if (!chk_count) {
        alert(str + "할 게시물을 하나 이상 선택하세요.");
        return false;
    }
    return true;
}

// 선택한 게시물 삭제
function select_delete() {
    var f = document.fboardlist;

    str = "삭제";
    if (!check_confirm(str))
        return;

    if (!confirm("선택한 게시물을 정말 "+str+" 하시겠습니까?\n\n한번 "+str+"한 자료는 복구할 수 없습니다"))
        return;

    f.action = "./delete_all.php";
    f.submit();
}

// 선택한 게시물 복사 및 이동
function select_copy(sw) {
    var f = document.fboardlist;

    if (sw == "copy")
        str = "복사";
    else
        str = "이동";
                       
    if (!check_confirm(str))
        return;

    var sub_win = window.open("", "move", "left=50, top=50, width=500, height=550, scrollbars=1");

    f.sw.value = sw;
    f.target = "move";
    f.action = "./move.php";
    f.submit();
}

</script>
<? } ?>
<script type="text/javascript" src="<?=$g4['path']?>/js/suggest.js"></script>
<script language="JavaScript">
    document.fsearchbox.stx.obj = 
        sug_set_properties(document.fsearchbox.stx, '<?=$board_skin_path?>/suggest_search_list_sellhome.php', true, true, true);
</script>
<!-- 게시판 목록 끝 -->
